import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/index',
    name: '购物街',
    component: () => import('@/views/Index.vue')
  },
  {
    path: '/order',
    name: '分类',
    component: () => import('@/views/Order/Order.vue')
  },

  {
    path: '/profile',
    name: '我的',
    component: () => import('@/views/Profile/Profile.vue')
  },
  {
    path: '/category',
    name: '购物车',
    component: () => import('@/views/Category/Category.vue')
  },
  {
    path: '/detail/:id',
    name: 'detail',
    component: () => import('@/views/detail/detail.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/Login/Login.vue')
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
